const express = require('express');
const router = express.Router();
const { 
  createInventory,
  getInventories,
  getInventoryById,
  updateInventory,
  deleteInventory,
  handleInventoryTransaction,
  getInventoryTransactions
} = require('../controllers/inventoryController');

// 创建库存
router.post('/create', createInventory);

// 获取库存列表
router.post('/list', getInventories);

// 获取库存详情
router.post('/detail', getInventoryById);

// 更新库存
router.post('/update', updateInventory);

// 删除库存
router.post('/delete', deleteInventory);

// 出入库操作
router.post('/transaction', handleInventoryTransaction);

// 获取操作记录
router.post('/transactions', getInventoryTransactions);

module.exports = router;